import { baseRequest, http } from '@/common/axios'
import axios from 'axios'
export default {
	// 获取用户列表
	getlist(data) {
		return baseRequest('/api/wpd-sanming/system/user/list', data, 'get')
	},
	// 3.	获取系统用户角色信息 和权限
	getUserPower(id, data) {
		return baseRequest('/api/wpd-sanming/system/user/' + id, data, 'get')
	},
	// 4.	获取系统用户性别信息
	get_user_sex(data) {
		return baseRequest('/api/wpd-sanming/system/dictData/dictType/user_sex', data, 'get')
	},
	// 5.	获取系统用户状态信息
	get_status(data) {
		return baseRequest('/api/wpd-sanming/system/dictData/dictType/status', data, 'get')
	},
	// 6.	新增用户
	saveUser(data) {
		return baseRequest('/api/wpd-sanming/system/user/save', data, 'post')
	},
	// 7.	修改用户
	updateToPost(data) {
		return baseRequest('/api/wpd-sanming/system/user/updateToPost', data, 'post')
	},
	// 	8.	重置密码
	resetPwd(data) {
		return http.put('/api/wpd-sanming/system/user/resetPwd', data)
	},
	// 9.	删除用户
	removeToGet(id, data) {
		return baseRequest('/api/wpd-sanming/system/user/removeToGet/' + id, data, 'get')
	},
	// 10.	野火IM 登录
	yhlogin(data) {
		return axios({ url: 'https://org.cjwsjyszyh.com:1207/api/login', method: 'post', data })
	},
	// 11.	野火IM  获取组织机构
	yhroot(Authtoken) {
		// let yhToekn = uni.getStorageSync('yhToekn')
		// return baseRequest('https://org.cjwsjyszyh.com:1207/api/organization/root', data, 'post')
		return axios({
			method: 'post',
			url: 'https://org.cjwsjyszyh.com:1207/api/organization/root',
			headers: {
				Authtoken: Authtoken
				// 'Content-Type': 'multipart/json;charset=UTF8'
				// 'X-Requested-With': 'XMLHttpRequest'
				// 'content-Type': 'application/x-www-form-urlencoded'
			}
		})
	},
	// 	12.	野火IM 创建用户
	yhcreate(data, Authtoken) {
		// let yhToekn = uni.getStorageSync('yhToekn')
		// return baseRequest('https://org.cjwsjyszyh.com:1207/api/organization/root', data, 'post')
		return axios({
			method: 'post',
			url: 'https://org.cjwsjyszyh.com:1207/api/employee/create',
			data,
			responseEncoding: 'utf8',
			headers: {
				Authtoken: Authtoken
				// 'Content-Type': 'multipart/json;charset=UTF8'
				// 'X-Requested-With': 'XMLHttpRequest'
				// 'content-Type': 'application/x-www-form-urlencoded'
			}
		})
	},
	// 	13.	更新野火id
	updateYhId(data) {
		return baseRequest('/api/wpd-sanming/system/user/updateYhId', data, 'post')
	},
	// 	14.	野火IM 更新野火用户
	yhupdate(data, Authtoken) {
		let yhToekn = uni.getStorageSync('yhToekn')
		// return baseRequest('https://org.cjwsjyszyh.com:1207/api/organization/root', data, 'post')
		return axios({
			method: 'post',
			url: 'https://org.cjwsjyszyh.com:1207/api/employee/update',
			data,
			responseEncoding: 'utf8',
			headers: {
				Authtoken: Authtoken
				// 'Content-Type': 'multipart/json;charset=UTF8'
				// 'X-Requested-With': 'XMLHttpRequest'
				// 'content-Type': 'application/x-www-form-urlencoded'
			}
		})
	},
	// 	15.	野火IM 删除野火用户
	yhdelete(data, Authtoken) {
		// let yhToekn = uni.getStorageSync('yhToekn')
		// return baseRequest('https://org.cjwsjyszyh.com:1207/api/organization/root', data, 'post')
		return axios({
			method: 'post',
			url: 'https://org.cjwsjyszyh.com:1207/api/employee/delete',
			data,
			// responseEncoding: 'utf8',
			headers: {
				Authtoken: Authtoken
				// 'Content-Type': 'multipart/json;charset=UTF8'
				// 'X-Requested-With': 'XMLHttpRequest'
				// 'content-Type': 'application/x-www-form-urlencoded'
			}
		})
	}
}
